package shoooter.entity.nonimage;

import shoooter.GameState;


public class Player extends NonImageEntity {

    public int hp;
    int max_hp;
    public int bombs = 0;
    public int rad;
    public int power;

    public GameState g;

    public Player() {
        this.hp = 100;
        this.power = 1;
    }

    public Player(int hp) {
        this.hp = hp;
        this.max_hp = (int) (hp*1.5);
        this.power = 1;
    }


    public void hit(int damage) { this.hp -= damage; }

    public boolean die() {
        if( this.hp <= 0 ) {
            this.setAlive(false);
            return true;
        }
        return false;
    }

    public void addSperimentalBomb() {
        bombs++;
    }

    public void useSperimentalBomb() {
        if(bombs > 0) {
            bombs--;
            g.newBomb(new Bomb(vPos));
        }
    }

}